<?php
define('web_s', 'johnsongod');
require dirname(__FILE__) . '/includes/init.php';
require adminroot.'includes/session.php';
$act = isset($_GET['act']) ? $_GET['act'] : 'info';
checkpermissions('serverconfig');
if($act == 'submit'){
	$str = "<?php\n";
	foreach($_POST as $k => $v){
		if(!$v && $v != 0){
			exit($lan[$k].'为空！');
		}
		$str .= "define('{$k}', '{$v}');\n";
		$smarty->assign($k, $v);
	}
	$r = file_put_contents(webroot.'data/config.php', $str);
}
$smarty->assign('mysql_host', mysql_host);
$smarty->assign('mysql_user', mysql_user);
$smarty->assign('mysql_pass', mysql_pass);
$smarty->assign('mysql_pass', mysql_pass);
$smarty->assign('mysql_db', mysql_db);
$smarty->assign('cache_time', cache_time);
$smarty->assign('web_template', web_template);
$smarty->assign('admin_template', admin_template);
$smarty->assign('charset',charset);
$smarty->assign('pagesize',pagesize);
$smarty->assign('goods_attr', get_goods_attr());

$smarty->display('serverconfig.htm');